Class HeapNode
- java.lang.Object
-
- edu.claflin.finder.logic.communities.struct.HeapNode
-
- All Implemented Interfaces:
java.lang.Comparable<HeapNode>
- Direct Known Subclasses:
IndexedHeapNode
public class HeapNode extends java.lang.Object implements java.lang.Comparable<HeapNode>
-
-
Constructor Summary
Constructors Constructor Description HeapNode(int j, double q)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description intcompareTo(HeapNode that)Compare this HeapNode to that HeapNode.intcompareToQ(HeapNode that)booleanequals(java.lang.Object o)intgetJ()doublegetQ()voidsetInfo(int j, double q)voidsetJ(int j)voidsetQ(double q)java.lang.StringtoString()
-
-
-
Field Detail
-
j
private int j
-
Q
private double Q
-
EPSILON
public static final double EPSILON
- See Also:
- Constant Field Values
-
-
Method Detail
-
getJ
public int getJ()
- Returns:
- the j
-
setJ
public void setJ(int j)
-
getQ
public double getQ()
- Returns:
- the maxQ
-
setQ
public void setQ(double q)
-
setInfo
public void setInfo(int j, double q)
-
equals
public boolean equals(java.lang.Object o)
- Overrides:
equalsin classjava.lang.Object
-
toString
public java.lang.String toString()
- Overrides:
toStringin classjava.lang.Object
-
compareTo
public int compareTo(HeapNode that)
Compare this HeapNode to that HeapNode. We want before means higher Q, then smaller j- Specified by:
compareToin interfacejava.lang.Comparable<HeapNode>- Parameters:
that- the HeapNode to compare this to- Returns:
- -1 if this goes before, 0 if they are equal, 1 if that goes before
-
compareToQ
public int compareToQ(HeapNode that)
-
-